<?php

namespace Database\Factories;

use App\Models\VoteCls;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use Overtrue\Pinyin\Pinyin;

/**
 * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Vote>
 */
class VoteFactory extends Factory
{
    /**
     * Define the model's default state.
     *
     * @return array<string, mixed>
     */
    public function definition()
    : array
    {

        $title = $this->faker->sentence();

        return [
            'vote_id'      => Str::uuid(),
            'admin_id'     => 1,
            'c_key'        => VoteCls::where('id',rand(1,2))->first()->id,
            'slug'         => Pinyin::permalink($title),
            'title'        => $title,
            'content'      => $this->faker->paragraphs(9,true),
            'introduction' => $this->faker->paragraphs(3,true),
            'vote_rule'    => $this->faker->paragraphs(13,true),
            'prize'        => $this->faker->paragraphs(3,true),
            'address'      => $this->faker->address . $this->faker->streetAddress,
            'tel_phone'    => $this->faker->phoneNumber,
            'sponsor'      => $this->faker->company,
        ];
    }
}
